<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/core/ipv6/icmp6.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('icmp6_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">icmp6.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="icmp6_8h.html">lwip/icmp6.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="prot_2icmp6_8h.html">lwip/prot/icmp6.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip6_8h.html">lwip/ip6.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip6__addr_8h.html">lwip/ip6_addr.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="inet__chksum_8h.html">lwip/inet_chksum.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pbuf_8h.html">lwip/pbuf.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="netif_8h.html">lwip/netif.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="nd6_8h.html">lwip/nd6.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mld6_8h.html">lwip/mld6.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip_8h.html">lwip/ip.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stats_8h.html">lwip/stats.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a94bec819e11f51c8088ca338f2e36c3d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp6_8c.html#a94bec819e11f51c8088ca338f2e36c3d">icmp6_input</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, struct <a class="el" href="structnetif.html">netif</a> *inp)</td></tr>
<tr class="separator:a94bec819e11f51c8088ca338f2e36c3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab480867394952904b5607d62315bdbac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp6_8c.html#ab480867394952904b5607d62315bdbac">icmp6_dest_unreach</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, enum <a class="el" href="prot_2icmp6_8h.html#a11fe21b0a8c1bc73ee887a96bf416ccf">icmp6_dur_code</a> c)</td></tr>
<tr class="separator:ab480867394952904b5607d62315bdbac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c0a84e0944263d92c9dc3ad094ffcb0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp6_8c.html#a3c0a84e0944263d92c9dc3ad094ffcb0">icmp6_packet_too_big</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, u32_t mtu)</td></tr>
<tr class="separator:a3c0a84e0944263d92c9dc3ad094ffcb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a358abb6555f6ca6b2b2b1412c9117bec"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp6_8c.html#a358abb6555f6ca6b2b2b1412c9117bec">icmp6_time_exceeded</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, enum <a class="el" href="prot_2icmp6_8h.html#ad06bbf4ee72635ece968db41cbe6869e">icmp6_te_code</a> c)</td></tr>
<tr class="separator:a358abb6555f6ca6b2b2b1412c9117bec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad01e5bc4690a2c6aeb534237a5a9b593"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp6_8c.html#ad01e5bc4690a2c6aeb534237a5a9b593">icmp6_time_exceeded_with_addrs</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, enum <a class="el" href="prot_2icmp6_8h.html#ad06bbf4ee72635ece968db41cbe6869e">icmp6_te_code</a> c, const <a class="el" href="ip6__addr_8h.html#aaca9e796e93a355294c4954c08d01762">ip6_addr_t</a> *src_addr, const <a class="el" href="ip6__addr_8h.html#aaca9e796e93a355294c4954c08d01762">ip6_addr_t</a> *dest_addr)</td></tr>
<tr class="separator:ad01e5bc4690a2c6aeb534237a5a9b593"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6094fa333b2cbf1b1b062e72313ef146"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp6_8c.html#a6094fa333b2cbf1b1b062e72313ef146">icmp6_param_problem</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, enum <a class="el" href="prot_2icmp6_8h.html#a3a817e777ebcfd705e8e5a1b4c5ae023">icmp6_pp_code</a> c, const void *pointer)</td></tr>
<tr class="separator:a6094fa333b2cbf1b1b062e72313ef146"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>IPv6 version of ICMP, as per RFC 4443. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ab480867394952904b5607d62315bdbac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab480867394952904b5607d62315bdbac">&#9670;&nbsp;</a></span>icmp6_dest_unreach()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp6_dest_unreach </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="prot_2icmp6_8h.html#a11fe21b0a8c1bc73ee887a96bf416ccf">icmp6_dur_code</a>&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an icmpv6 'destination unreachable' packet.</p>
<p>This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the input packet for which the 'unreachable' should be sent, p-&gt;payload pointing to the IPv6 header </td></tr>
    <tr><td class="paramname">c</td><td>ICMPv6 code for the unreachable type </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a94bec819e11f51c8088ca338f2e36c3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a94bec819e11f51c8088ca338f2e36c3d">&#9670;&nbsp;</a></span>icmp6_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp6_input </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>inp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Process an input ICMPv6 message. Called by ip6_input.</p>
<p>Will generate a reply for echo requests. Other messages are forwarded to nd6_input, or mld6_input.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the mld packet, p-&gt;payload pointing to the icmpv6 header </td></tr>
    <tr><td class="paramname">inp</td><td>the netif on which this packet was received </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3c0a84e0944263d92c9dc3ad094ffcb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c0a84e0944263d92c9dc3ad094ffcb0">&#9670;&nbsp;</a></span>icmp6_packet_too_big()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp6_packet_too_big </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32_t&#160;</td>
          <td class="paramname"><em>mtu</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an icmpv6 'packet too big' packet.</p>
<p>This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the input packet for which the 'packet too big' should be sent, p-&gt;payload pointing to the IPv6 header </td></tr>
    <tr><td class="paramname">mtu</td><td>the maximum mtu that we can accept </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6094fa333b2cbf1b1b062e72313ef146"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6094fa333b2cbf1b1b062e72313ef146">&#9670;&nbsp;</a></span>icmp6_param_problem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp6_param_problem </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="prot_2icmp6_8h.html#a3a817e777ebcfd705e8e5a1b4c5ae023">icmp6_pp_code</a>&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>pointer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an icmpv6 'parameter problem' packet.</p>
<p>This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost and the calculated offset would be wrong (calculated against <a class="el" href="ip_8h.html#af9bf74750c9d7a219ee88d240300fe69">ip6_current_header()</a>).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the input packet for which the 'param problem' should be sent, p-&gt;payload pointing to the IP header </td></tr>
    <tr><td class="paramname">c</td><td>ICMPv6 code for the param problem type </td></tr>
    <tr><td class="paramname">pointer</td><td>the pointer to the byte where the parameter is found </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a358abb6555f6ca6b2b2b1412c9117bec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a358abb6555f6ca6b2b2b1412c9117bec">&#9670;&nbsp;</a></span>icmp6_time_exceeded()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp6_time_exceeded </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="prot_2icmp6_8h.html#ad06bbf4ee72635ece968db41cbe6869e">icmp6_te_code</a>&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an icmpv6 'time exceeded' packet.</p>
<p>This function must be used only in direct response to a packet that is being received right now. Otherwise, address zones would be lost.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the input packet for which the 'time exceeded' should be sent, p-&gt;payload pointing to the IPv6 header </td></tr>
    <tr><td class="paramname">c</td><td>ICMPv6 code for the time exceeded type </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad01e5bc4690a2c6aeb534237a5a9b593"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad01e5bc4690a2c6aeb534237a5a9b593">&#9670;&nbsp;</a></span>icmp6_time_exceeded_with_addrs()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp6_time_exceeded_with_addrs </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="prot_2icmp6_8h.html#ad06bbf4ee72635ece968db41cbe6869e">icmp6_te_code</a>&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="ip6__addr_8h.html#aaca9e796e93a355294c4954c08d01762">ip6_addr_t</a> *&#160;</td>
          <td class="paramname"><em>src_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="ip6__addr_8h.html#aaca9e796e93a355294c4954c08d01762">ip6_addr_t</a> *&#160;</td>
          <td class="paramname"><em>dest_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an icmpv6 'time exceeded' packet, with explicit source and destination addresses.</p>
<p>This function may be used to send a response sometime after receiving the packet for which this response is meant. The provided source and destination addresses are used primarily to retain their zone information.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the input packet for which the 'time exceeded' should be sent, p-&gt;payload pointing to the IPv6 header </td></tr>
    <tr><td class="paramname">c</td><td>ICMPv6 code for the time exceeded type </td></tr>
    <tr><td class="paramname">src_addr</td><td>source address of the original packet, with zone information </td></tr>
    <tr><td class="paramname">dest_addr</td><td>destination address of the original packet, with zone information </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.html">core</a></li><li class="navelem"><a class="el" href="dir_da9c6f43d3cd00be3de224bac907a425.html">ipv6</a></li><li class="navelem"><a class="el" href="icmp6_8c.html">icmp6.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
